.TH "Zebulon::GeneticAlgorithms::Chromosome" 3 "13 Oct 2009" "Version 2" "zebulon" \" -*- nroff -*-
.ad l
.nh
.SH NAME
Zebulon::GeneticAlgorithms::Chromosome \- 
.PP
Structure for representing a chromosome within a genetic algorithm.  

.SH SYNOPSIS
.br
.PP
.PP
\fC#include <chromosome.h>\fP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "void \fBSetFitness\fP (const double fitness)"
.br
.ti -1c
.RI "double \fBGetFitness\fP () const "
.br
.ti -1c
.RI "virtual unsigned int \fBGetLength\fP () const =0"
.br
.ti -1c
.RI "virtual double \fBComputeCompatibility\fP (const \fBChromosome\fP *chromosome) const =0"
.br
.RI "\fICalculate the compabitibilty between the this chromosome and the argument. This is used for finding chromosomes that belong in the same species. \fP"
.ti -1c
.RI "virtual \fBChromosome\fP \fBPerformCrossover\fP (const \fBChromosome\fP *parent1, const \fBChromosome\fP *parent2, const \fBSettings::Crossover\fP &crossoverInfo) const =0"
.br
.RI "\fIPerform crossover between two parents using the crossover settings and generate an offspring chromosome. \fP"
.ti -1c
.RI "virtual \fBChromosome\fP * \fBClone\fP () const =0"
.br
.ti -1c
.RI "virtual bool \fBMutate\fP (const \fBSettings::Mutation\fP &mutation)=0"
.br
.RI "\fIApply mutation to your gene based on the rate provided. \fP"
.ti -1c
.RI "virtual int \fBWrite\fP (FILE *fp) const "
.br
.RI "\fIWrite information to a file. It is up to the developer to choose file format. \fP"
.ti -1c
.RI "virtual int \fBWrite\fP (CxUtils::Packet &packet) const "
.br
.RI "\fIWrite information within a packet structure. This is useful for developing applications requiring distribution of processing over a network. \fP"
.ti -1c
.RI "virtual int \fBRead\fP (FILE *fp)"
.br
.RI "\fIRead information from a file based on format chosen using the Write method. \fP"
.ti -1c
.RI "virtual int \fBRead\fP (const CxUtils::Packet &packet)"
.br
.RI "\fIRead information within a packet structure. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static bool \fBPerformCrossover\fP (const Gene::Vector &parent1, const Gene::Vector &parent2, const \fBSettings::Crossover\fP &crossoverInfo, Gene::Vector &offspring)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "double \fBmFitness\fP"
.br
.RI "\fIFitness of the chromosome [0,1]. \fP"
.in -1c
.SH "Detailed Description"
.PP 
Structure for representing a chromosome within a genetic algorithm. 

A chromosome is how solutions you want to evolve are represented withing a genetic algorithm. This interface lets developers design chromosomes that can be used within the Engine class which will perform evolution. 
.SH "Member Function Documentation"
.PP 
.SS "virtual \fBChromosome\fP* Zebulon::GeneticAlgorithms::Chromosome::Clone () const\fC [pure virtual]\fP"\fBReturns:\fP
.RS 4
A duplicate of your gene data. 
.RE
.PP

.SS "virtual double Zebulon::GeneticAlgorithms::Chromosome::ComputeCompatibility (const \fBChromosome\fP * chromosome) const\fC [pure virtual]\fP"
.PP
Calculate the compabitibilty between the this chromosome and the argument. This is used for finding chromosomes that belong in the same species. \fBParameters:\fP
.RS 4
\fIchromosome\fP \fBChromosome\fP to calculate compatibility with.
.RE
.PP
\fBReturns:\fP
.RS 4
Compatibility with chromosome. 
.RE
.PP

.SS "virtual unsigned int Zebulon::GeneticAlgorithms::Chromosome::GetLength () const\fC [pure virtual]\fP"\fBReturns:\fP
.RS 4
Length of chromosome. 
.RE
.PP

.SS "virtual bool Zebulon::GeneticAlgorithms::Chromosome::Mutate (const \fBSettings::Mutation\fP & mutation)\fC [pure virtual]\fP"
.PP
Apply mutation to your gene based on the rate provided. \fBParameters:\fP
.RS 4
\fImutation\fP Mutation information to use for mutation of chromosome.
.RE
.PP
\fBReturns:\fP
.RS 4
True on success, otherwise false. 
.RE
.PP

.SS "virtual \fBChromosome\fP Zebulon::GeneticAlgorithms::Chromosome::PerformCrossover (const \fBChromosome\fP * parent1, const \fBChromosome\fP * parent2, const \fBSettings::Crossover\fP & crossoverInfo) const\fC [pure virtual]\fP"
.PP
Perform crossover between two parents using the crossover settings and generate an offspring chromosome. \fBParameters:\fP
.RS 4
\fIparent1\fP First parent to use for crossover. 
.br
\fIparent2\fP Second parent to use for crossover. 
.br
\fIcrossoverInfo\fP Type of crossover and settings involved.
.RE
.PP
\fBReturns:\fP
.RS 4
A pointer to a newly allocated \fBChromosome\fP which is the offspring/result of crossover between the two parents. 
.RE
.PP

.SS "virtual int Zebulon::GeneticAlgorithms::Chromosome::Read (const CxUtils::Packet & packet)\fC [inline, virtual]\fP"
.PP
Read information within a packet structure. \fBParameters:\fP
.RS 4
\fIpacket\fP Packet buffer to de-serialize data from.
.RE
.PP
\fBReturns:\fP
.RS 4
Number of bytes read. 
.RE
.PP

.SS "virtual int Zebulon::GeneticAlgorithms::Chromosome::Write (CxUtils::Packet & packet) const\fC [inline, virtual]\fP"
.PP
Write information within a packet structure. This is useful for developing applications requiring distribution of processing over a network. \fBParameters:\fP
.RS 4
\fIpacket\fP Packet buffer to serialize data to.
.RE
.PP
\fBReturns:\fP
.RS 4
Number of bytes written. 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for zebulon from the source code.
